/*
 * dnsTest.cpp
 *
 *  Created on: Dec 20, 2013
 *      Author: m
 */

#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include "../DNSService.h"

int main ( int argc, char* argv[] )
{
    int address;
    std::string name;

    if ( argc != 2 )
    {
        std::cerr << "Cantidad de argumentos invalidos." << std::endl;
        std::cerr << "Uso: ." << argv[0] << " [nombre]" << std::endl;
        exit( 1 );
    }

    /*
     * Save values of command line arguments
     */
    name = argv[1];

    //for ( int i = 0; i < 100; i++ )
    while ( true )
    {
        address = DNSService::resolve( name );

        std::cout << "The name " << name << " is associated with the address: " << address << std::endl;
    }

    std::cout << "PRESS ANY KEY TO QUIT" << std::endl;
    int a;
    std::cin >> a;

    return 0;
}
